<template>
	<view class="page-body">
		<!-- 页面内容开始 -->

		<!-- 表格搜索组件开始 -->
		<vk-data-table-query
			v-model="queryForm1.formData"
			:columns="queryForm1.columns"
			:main-columns="['user_id','order_no','receiver_mobile','receiver_name']"
			size="mini"
			@search="search"
		></vk-data-table-query>
		<!-- 表格搜索组件结束 -->

		<!-- 自定义按钮区域开始 -->
		<view>
			<el-row>
				<el-radio-group v-model="queryForm1.formData.status" size="mini" @change="search">
					<el-radio-button label="">全部订单</el-radio-button>
					<el-badge :value="orderCountGroup['-2']" :max="99" class="group-badge">
					  <el-radio-button :label="-2">申请退款中</el-radio-button>
					</el-badge>
					<el-badge :value="orderCountGroup['0']" :max="99" class="group-badge">
					  <el-radio-button :label="0">未付款</el-radio-button>
					</el-badge>
					<el-badge :value="orderCountGroup['1']" :max="99" class="group-badge">
					  <el-radio-button :label="1">已付款</el-radio-button>
					</el-badge>
					<el-badge :value="orderCountGroup['2']" :max="99" class="group-badge">
					  <el-radio-button :label="2">准备发货中</el-radio-button>
					</el-badge>
					<el-badge :value="orderCountGroup['3']" :max="99" class="group-badge">
					  <el-radio-button :label="3">已部分发货</el-radio-button>
					</el-badge>
					<el-radio-button :label="4">已全部发货</el-radio-button>
					<el-radio-button :label="5">已收货</el-radio-button>
					<el-radio-button :label="6">已完成</el-radio-button>
					<el-radio-button :label="100">待核销</el-radio-button>
					<el-radio-button :label="101">已核销</el-radio-button>
				</el-radio-group>

				<el-dropdown v-if="table1.multipleSelection" :split-button="false"	trigger="click" @command="batchBtn" style="margin-left: 10px;">
					<el-button type="danger" size="mini" style=""
						:disabled="table1.multipleSelection.length === 0"
					>
						批量操作<i class="el-icon-arrow-down el-icon--right"></i>
					</el-button>
					<el-dropdown-menu slot="dropdown">
						<el-dropdown-item :command="1">批量准备发货</el-dropdown-item>
						<el-dropdown-item :command="2">批量取消准备发货</el-dropdown-item>
					</el-dropdown-menu>
				</el-dropdown>

				<el-button type="warning" size="mini" icon="el-icon-edit-outline" @click="showExportExcel"  style="margin-left: 10px;"> 订单导出xls </el-button>

			</el-row>
		</view>
		<!-- 自定义按钮区域结束 -->

		<!-- 表格组件开始 -->
		<vk-data-table
			ref="table1"
			:action="table1.action"
			:columns="table1.columns"
			:query-form-param="queryForm1"
			:right-btns="['more']"
			:right-btns-more="table1.rightBtnsMore"
			:custom-right-btns="table1.customRightBtns"
			right-btns-align="right"
			size="mini"
			:selection="true"
			:left-fixed="false"
			:right-fixed="false"
			:row-no="true"
			:pagination="true"
			@current-change="currentChange"
			@selection-change="selectionChange"
		>

			<template v-slot:goods_sku_list="{ row, column, index }">
				<view>
					<view v-if="row.type == 'recharge'">
						<view style="display: flex;align-items: center;">
							<view style="width: 40px;">
								<el-image style="width: 40px; height: 40px;" :src="row.app_info.app_logo"></el-image>
							</view>
							<view style="margin-left: 8px;flex: 1;">
								<view style="white-space:initial">
									<text>余额</text>
									<text style="margin-left: 2px;">× {{ row.amount_info.recharge_balance }}</text>
								</view>
								<view>
									<text style="color: #f2303e;">￥{{ row.amount_info.used_cash_amount }}</text>
									<el-popconfirm v-if="[1,2,3].indexOf(row.status) > -1" title="退款后，余额和返佣会自动扣除，但现金需要人工操作退款，是否退款？" @confirm="rechargeRefund(row)">
										<el-button slot="reference" size="mini" style="margin-left: 10px;" type="text">主动退款</el-button>
									</el-popconfirm>
								</view>
							</view>
						</view>
					</view>
					<view v-else>
						<view style="display: flex;align-items: center;" :style="{marginTop: index > 0 ? '8px' :'0px'}" v-for="(item,index) in row.goods_sku_list" :key="index">
							<view style="width: 40px;">
								<el-image style="width: 40px; height: 40px;" :src="item.image"></el-image>
							</view>
							<view style="margin-left: 8px;flex: 1;">
								<view style="white-space:initial">
									<text class="text-two">{{ item.goods_name }}</text>
									<text style="color: #aaaaaa;">{{ item.sku_name }}</text>
									<text style="margin-left: 2px;">× {{ item.buy_num }}</text>
								</view>
								<view style="text-align: right;">
									<text style="color: #f2303e;">￥{{ vk.pubfn.priceFilter(item.real_price) }}</text>
									<el-tag type="danger" effect="dark" size="mini" v-if="item.vip_discount_amount > 0" style="margin-left: 5px; padding: 0 4px;font-size: 12px;transform: scale(0.9); ">会员价</el-tag>
									<el-tag type="danger" effect="dark" size="mini" v-if="item.is_seckill === 1" style="margin-left: 5px; padding: 0 4px;font-size: 12px;transform: scale(0.9); ">秒杀</el-tag>
									<el-tag type="danger" effect="dark" size="mini" v-if="item.group_buy_discount_price" style="margin-left: 5px; padding: 0 4px;font-size: 12px;transform: scale(0.9); ">拼团</el-tag>
								</view>
							</view>
						</view>
					</view>
				</view>

			</template>

			<template  v-slot:amount_info="{ row, column, index }">
				<view style="display:grid; grid-template-columns: 40px 60px 40px 60px;" v-if="row.is_group_buy_order">
					<view>原价 : </view><view>{{ $fn.priceFilter(row.amount_info.total_amount,'-') }}</view><view>应付 : </view><view>{{ $fn.priceFilter(row.amount_info.should_payment_amount,'-') }}</view>
					<view>拼团 : </view><view>{{ $fn.priceFilter(row.amount_info.group_buy_cut_price,'-') }}</view><view>现金 : </view><view>{{ $fn.priceFilter(row.amount_info.used_cash_amount,'-') }}</view>
					<view>优惠 : </view><view>{{ $fn.priceFilter(row.discount_info.total_discount,'-') }}</view><view>余额 : </view><view>{{ $fn.priceFilter(row.amount_info.used_balance_amount,'-') }}</view>
					<view>快递 : </view><view>{{ $fn.priceFilter(row.amount_info.original_express_amount,'-') }}</view><view>退款 : </view><view>{{ $fn.priceFilter(row.amount_info.refund_amount,'-') }}</view>
					<view>折扣 : </view><view>{{ $fn.discountFilter(row.discount_info.real_discount) }}</view>
				</view>
				<view style="display:grid; grid-template-columns: 40px 60px 40px 60px;"  v-else-if="row.has_seckill">
					<view>原价 : </view><view>{{ $fn.priceFilter(row.amount_info.total_amount,'-')  }}</view><view>应付 : </view><view>{{ $fn.priceFilter(row.amount_info.should_payment_amount,'-') }}</view>
					<view>秒杀 : </view><view>{{ $fn.priceFilter(row.amount_info.seckill_cut_price,'-') }}</view><view>现金 : </view><view>{{ $fn.priceFilter(row.amount_info.used_cash_amount,'-') }}</view>
					<view>优惠 : </view><view>{{ $fn.priceFilter(row.discount_info.total_discount,'-') }}</view><view>余额 : </view><view>{{ $fn.priceFilter(row.amount_info.used_balance_amount,'-') }}</view>
					<view>快递 : </view><view>{{ $fn.priceFilter(row.amount_info.original_express_amount,'-') }}</view><view>退款 : </view><view>{{ $fn.priceFilter(row.amount_info.refund_amount,'-') }}</view>
					<view>折扣 : </view><view>{{ $fn.discountFilter(row.discount_info.real_discount) }}</view>
				</view>
				<view style="display:grid; grid-template-columns: 40px 60px 40px 60px;"  v-else-if="row.is_integral">
					<view>原价 : </view><view>{{ $fn.priceFilter(row.amount_info.total_amount,'-')  }}</view><view>应付 : </view><view>{{ $fn.priceFilter(row.amount_info.should_payment_amount,'-') }}</view>
					<view>积分 : </view><view>{{ $fn.priceFilter(row.amount_info.use_integral,'-') }}</view><view>现金 : </view><view>{{ $fn.priceFilter(row.amount_info.used_cash_amount,'-') }}</view>
					<view>优惠 : </view><view>{{ $fn.priceFilter(row.discount_info.total_discount,'-') }}</view><view>余额 : </view><view>{{ $fn.priceFilter(row.amount_info.used_balance_amount,'-') }}</view>
					<view>快递 : </view><view>{{ $fn.priceFilter(row.amount_info.original_express_amount,'-') }}</view><view>退款 : </view><view>{{ $fn.priceFilter(row.amount_info.refund_amount,'-') }}</view>
					<view>折扣 : </view><view>{{ $fn.discountFilter(row.discount_info.real_discount) }}</view>
				</view>
				<view style="display:grid; grid-template-columns: 40px 60px 40px 60px;" v-else>
					<!-- 此处的快递费用要显示原始快递费用,因为优惠金额包含了快递的优惠金额 -->
					<view>商品 : </view><view>{{ $fn.priceFilter(row.amount_info.goods_amount,'-')  }}</view><view>应付 : </view><view>{{ $fn.priceFilter(row.amount_info.should_payment_amount,'-') }}</view>
					<view>快递 : </view><view>{{ $fn.priceFilter(row.amount_info.original_express_amount,'-') }}</view><view>现金 : </view><view>{{ $fn.priceFilter(row.amount_info.used_cash_amount,'-') }}</view>
					<view>优惠 : </view><view>{{ $fn.priceFilter(row.discount_info.total_discount,'-') }}</view><view>余额 : </view><view>{{ $fn.priceFilter(row.amount_info.used_balance_amount,'-') }}</view>
					<view>折扣 : </view><view>{{ $fn.discountFilter(row.discount_info.real_discount) }}</view><view>退款 : </view><view>{{ $fn.priceFilter(row.amount_info.refund_amount,'-') }}</view>
				</view>
			</template>


		</vk-data-table>
		<!-- 表格组件结束 -->

		<userRecords v-model="formDatas.userRecords" @success="refresh"></userRecords>
		<!-- 订单详情 -->
		<orderDetail v-model="formDatas.orderDetail" @success="refresh"></orderDetail>
		<!-- 修改收货信息 -->
		<updateReceiverInfo v-model="formDatas.updateReceiverInfo"></updateReceiverInfo>
		<!-- 修改备注 -->
		<updateRemark v-model="formDatas.updateRemark"></updateRemark>
		<!-- 物流 -->
		<express v-model="formDatas.express" @success="refresh"></express>
		<!-- 退款 -->
		<orderRefund v-model="formDatas.orderRefund" @success="refresh"></orderRefund>
		<!-- 退款审核 -->
		<orderRefundExamine v-model="formDatas.orderRefundExamine"></orderRefundExamine>
		<!-- 发货 -->
		<orderSend v-model="formDatas.orderSend"></orderSend>
		<!-- 订单改价 -->
		<updatePrice v-model="formDatas.updatePrice" @success="refresh"></updatePrice>
		<!-- 订单导出 -->
		<exportExcel v-model="formDatas.exportExcel" @success="exportExcel"></exportExcel>
		<!-- 页面内容结束 -->
	</view>
</template>

<script>
	var that;													// 当前页面对象
	var vk = uni.vk;									// vk实例
	var originalForms = {};						// 表单初始化数据
	import userRecords from './userRecords'
	import orderDetail from './form/orderDetail'
	import updateReceiverInfo from './form/updateReceiverInfo'
	import updateRemark from './form/updateRemark'
	import express from './form/express'
	import orderRefund from './form/orderRefund'
	import orderRefundExamine from './form/orderRefundExamine'
	import orderSend from './form/orderSend'
	import updatePrice from './form/updatePrice'
	import exportExcel from './form/exportExcel'

	export default {
		components:{
			userRecords,
			orderDetail,
			updateReceiverInfo,
			updateRemark,
			express,
			orderRefund,
			orderRefundExamine,
			orderSend,
			updatePrice,
			exportExcel
		},
		data() {
			// 页面数据变量
			return {
				// 页面是否请求中或加载中
				loading:false,
				orderCountGroup:{},
				// init请求返回的数据
				data:{

				},
				// 表格相关开始 -----------------------------------------------------------
				table1:{
					// 表格数据请求地址
					action:"admin/business/sys/order.getList",
					// 表格字段显示规则
					columns:[
						{ key:"goods_sku_list", title:"商品信息", type:"text", minWidth:210, align:"left", showOverflowTooltip:false, show:["row"],
							formatter: function(val=[], row, column, index) {
								let str = "";
								val.map((item, index) => {
									let goods_name = item.goods_name;
									if (item.sku_name !== "默认") {
										goods_name = `${item.goods_name}（${item.sku_name}）`;
									}
									str += `${goods_name}*${item.buy_num} `;
								});
								return str;
							}
						},
						{ key:"order_info", title:"订单信息", type:"group", minWidth:250, showOverflowTooltip:false, showOverflowTooltip: false,
							columns:[
								{ key:"order_no", title:"订单编号", type:"text" },
								{ key:"status", title:"订单状态", type:"tag", size:"mini",
									formatter: function(val, row, column, index) {
										let list = [
											{ value:-4, label:'已关闭', tagType:'info' },
											{ value:-3, label:'已全额退款', tagType:'info' },
											{ value:-2, label:'申请退款中', tagType:'danger' },
											{ value:-1, label:'已取消', tagType:'info' },
											{ value:0, label:'未付款', tagType:'info' },
											{ value:1, label:'已付款', tagType:'success' },
											{ value:2, label:'准备发货中', tagType:'success' },
											{ value:3, label:'已部分发货', tagType:'warning' },
											{ value:4, label:'已全部发货', tagType:'success' },
											{ value:5, label:'已收货', tagType:'success' },
											{ value:6, label:'已完成', tagType:'success' }
										];
										if (row.order_type == 1) {
											list = [
												{ value:-4, label:'已关闭', tagType:'info' },
												{ value:-3, label:'已全额退款', tagType:'info' },
												{ value:-2, label:'申请退款中', tagType:'danger' },
												{ value:-1, label:'已取消', tagType:'info' },
												{ value:0, label:'未付款', tagType:'info' },
												{ value:4, label:'待核销', tagType:'success' },
												{ value:5, label:'已核销', tagType:'success' },
												{ value:6, label:'已完成', tagType:'success' }
											];
										}
										let item = vk.pubfn.getListItem(list, "value", val);
										return { val:item.label, tagType:item.tagType };
									},
								},
								{ key:"pay_time", title:"付款时间", type:"time", defaultValue:"-" },
								{ key:"buyer_remark", title:"买家留言", type:"text", style:"color:#f56c6c" },
								{ key:"seller_remark", title:"商家备注", type:"text", style:"color:#e6a23c" },
								{ key:"seller_note", title:"商家备注", type:"text", style:"color:#e6a23c" },
							]
						},
						{
							key:"buyer_info", title:"买家信息", type:"group", minWidth:140, align:"left", showOverflowTooltip: false,
							columns:[
								{ key:"buyer_info.avatar", title:"头像", type:"avatar", shape:"square",
									buttons:[
										{
											title:"查看用户",
											type:"text",
											show:["row"], // 在表格行内和详情页弹窗内展示此按钮
											click:function(obj){
												uni.vk.navigateTo(`/pages/user/list?_id=${obj.row.user_id}`);
											}
										}
									]
								},
								{ key:"buyer_info.nickname", title:"昵称", type:"text" },
								{ key:"pay_type", title:"付款", type:"select",
									data:[
										{ value:"wxpay", label:'微信' },
										{ value:"alipay", label:'支付宝' },
										{ value:"balance", label:'余额' },
										{ value:"offline", label:'线下支付' },
										{ value:"none", label:'无需支付' },
									]
								},
							]
						},
						{
							key:"amount_info", title:"金额（元）", type:"object", minWidth:220, show:["row"], showOverflowTooltip: false,
							columns:[
								{ key:"total_amount", title:"原价", type:"money", defaultValue:"-" },
								{ key:"should_payment_amount", title:"应付", type:"money", defaultValue:"-" },
								{ key:"payment_amount", title:"实付", type:"money", defaultValue:"-" },
								{ key:"express_amount", title:"快递", type:"money", defaultValue:0 },
							]
						},
						{ key:"express_info", title:"收货地址", type:"object", minWidth:200, align:"left", showOverflowTooltip: false,
							columns:[
								{ key:"formatted_address", title:"收货地址", type:"text", defaultValue:"-", show:["none"] },
								{ key:"position", title:"省市区", type:"address", defaultValue:"-" },
								{ key:"position.address", title:"街道", type:"text" },
								{ key:"receiver_name", title:"姓名", type:"text" },
								{ key:"receiver_mobile", title:"手机", type:"text", defaultValue:"-" },
							]
						},
						{ key:"fx_info", title:"分销信息", type:"group", minWidth:190, align:"left", showOverflowTooltip: false,
							columns:[
								{ key:"fx.settlement_status", title:"结算状态", type:"tag", size:"mini",
									data:[
										{ value:0, label:"未结算", tagType:"info" },
										{ value:1, label:"已结算", tagType:"success" },
										{ value:2, label:"不结算", tagType:"danger" }
									],
									buttons: [
										{
											title: "奖励明细",
											type: "text",
											show: ["row"],
											showRule: function(formData) {
												return (formData.fx.settlement_status === 1) ? true : false;
											},
											click: function(options) {
												vk.pubfn.openForm('userRecords',{ item: options.formData })
											}
										}
									]
								},
								{ key:"fx.plan_exec_time", title:"计划结算", type:"time" },
								{ key:"fx.settlement_time", title:"实际结算", type:"time" },
								{
									key:"inviterUserInfo.nickname", title:"上级", type:"text",
									formatter: function(val, row, column, index) {
										let str = "归属系统";
										if (row.inviterUserInfo){
											str = row.inviterUserInfo.nickname;
											if(row.inviterUserInfo.comment){
												str += `（${row.inviterUserInfo.comment}）`;
											}
										}
										return str;
									}
								},
								{ key:"inviterUserInfo._id", title:"上级ID", type:"text" }
							]
						},
					],
					// 多选框选中的值
					multipleSelection:[],
					// 当前高亮的记录
					selectItem:"",
					rightBtnsMore:[
						{
							title: '查看订单详情',
							onClick: (item)=>{
								//that.$refs.table1.showDetail(item);
								vk.pubfn.openForm('orderDetail',{ item });
							}
						},
						{
							title: '查看快递物流',
							onClick: (item)=>{
								vk.pubfn.openForm('express',{ item });
							},
							show:(item)=>{
								return [3,4,5,6].indexOf(item.status) > -1 && item.order_type === 0; // 只有已发货订单才可以查看快递信息
							},
						},
						{
							title: '修改收货信息',
							onClick: (item)=>{
								vk.pubfn.openForm('updateReceiverInfo',{ item });
							},
							show:(item)=>{
								return item.order_type === 0; // 只有实物商品订单才可以修改收货地址
							},
						},
						{
							title: '修改商家备注',
							onClick: (item)=>{
								vk.pubfn.openForm('updateRemark',{ item });
							}
						},
						{
							title: '订单主动退款',
							onClick: (item)=>{
								vk.pubfn.openForm('orderRefund',{ item });
							},
							show:(item)=>{
								return [1,2,3,4,5].indexOf(item.status) > -1; // 只有已付款订单才可以退款(已完成的订单不可以退款)
							},
						},
						{
							title: '订单主动改价',
							onClick: (item)=>{
								vk.pubfn.openForm('updatePrice',{ item });
							},
							show:(item)=>{
								return item.status === 0; // 只有未付款订单才可以改价
							},
						},
						{
							title: '修改发货信息',
							onClick: (item)=>{
								vk.pubfn.openForm('orderSend',{ item });
							},
							show:(item)=>{
								return [4,5,6].indexOf(item.status) > -1 && item.order_type === 0; // 只有已发货的订单才可以修改发货信息
							},
						}
					],
					customRightBtns: [
						{
							title: '发货', type: 'primary', icon: 'el-icon-edit',
							onClick:(item)=>{
								vk.pubfn.openForm('orderSend',{ item });
							},
							show:(item)=>{
								return item.enable_delivery && [1,2,3].indexOf(item.status) > -1; // 只有标记为可发货的订单才可以发货
							},
						},
						{
							title: '处理', type: 'warning', icon: 'el-icon-edit',
							onClick:(item)=>{
								vk.pubfn.openForm('orderRefundExamine',{ item });
							},
							show:(item)=>{
								return [-2,].indexOf(item.status) > -1; // 只有标记退款申请中的订单才可以同意退款
							},
						}
					],
				},
				// 表格相关结束 -----------------------------------------------------------
				// 表单相关开始 -----------------------------------------------------------
				// 查询表单请求数据
				queryForm1:{
					// 查询表单数据源，可在此设置默认值
					formData:{
						status:""
					},
					// 查询表单的字段规则 fieldName:指定数据库字段名,不填默认等于key
					columns:[
						{ key:"user_id", title:"下单用户", type:"remote-select", placeholder:"请输入用户账号", width:160,
							action:"admin/select/kh/user",
						},
						{ key:"order_no", title:"订单号", type:"text", width:160, mode:"%%" },
						{ key:"receiver_name", fieldName:"express_info.receiver_name", title:"收货人姓名", type:"text", width:160, mode:"%%" },
						{ key:"receiver_mobile", fieldName:"express_info.receiver_mobile", title:"收货人手机", type:"text", width:160, mode:"%%" },
						{ key:"pay_time", title:"付款时间", type:"datetimerange", width:340, mode:"[]" },
						{ key:"send_time", title:"发货时间", type:"datetimerange", width:340, mode:"[]" },
						{ key:"position", fieldName:"express_info.position", title:"省市区", type:"address", width:160, mode:"=" },
						{ key:"status", title:"订单状态", type:"text", width:160, mode:"=", show:["none"] },
					]
				},
				// 其他弹窗表单
				formDatas:{},
				// 表单相关结束 -----------------------------------------------------------
			};
		},
		// 监听 - 页面每次【加载时】执行(如：前进)
		onLoad(options = {}) {
			that = this;
			vk = that.vk;
			that.options = options;
			that.init(options);
		},
		// 监听 - 页面【首次渲染完成时】执行。注意如果渲染速度快，会在页面进入动画完成前触发
		onReady() {},
		// 监听 - 页面每次【显示时】执行(如：前进和返回) (页面每次出现在屏幕上都触发，包括从下级页面点返回露出当前页面)
		onShow() {},
		// 监听 - 页面每次【隐藏时】执行(如：返回)
		onHide() {},
		// 函数
		methods: {
			// 页面数据初始化函数
			init(options) {
				that.groupCountOrderForStatus();
			},
			// 获取 申请退款中 已付款 准备发货中 已部分发货 的订单的数量
			groupCountOrderForStatus(){
				vk.callFunction({
					url: 'admin/business/sys/order.groupCountOrderForStatus',
					data:that.queryForm1,
					success: (data) => {
						that.orderCountGroup = data.group;
					}
				});
			},
			// 页面跳转
			pageTo(path) {
				vk.navigateTo(path);
			},
			// 表单重置
			resetForm(){
				vk.pubfn.resetForm(originalForms, that);
			},
			// 搜索
			search(){
				that.$refs.table1.search();
				that.groupCountOrderForStatus();
			},
			// 刷新
			refresh(){
				that.$refs.table1.refresh();
				that.groupCountOrderForStatus();
			},
			// 获取当前选中的行的数据
			getCurrentRow(){
				return that.$refs.table1.getCurrentRow();
			},
			// 监听 - 行的选中高亮事件
			currentChange(val){
				that.table1.selectItem = val;
			},
			// 当选择项发生变化时会触发该事件
			selectionChange(list) {
				that.table1.multipleSelection = list;
			},
			// 监听 - 批量操作的按钮点击事件
			batchBtn(index){
				switch(index){
					case 1: that.readyDeliver(1); break;
					case 2: that.readyDeliver(-1); break;
					default : break;
				}
			},
			// 批量准备发货
			readyDeliver(mode){
				let ids = [];
				let count = 0;
				let checkStatus = "";
				let errorMsg = "";
				if(mode==1){
					// 准备发货
					checkStatus = 1;
					errorMsg = "订单状态为已付款才能修改!";
				}else{
					mode = -1;
					// 取消准备发货
					checkStatus = 2;
					errorMsg = "订单状态为准备发货状态才能取消!";
				}
				// 检测订单状态
				that.table1.multipleSelection.map((item,index)=>{
					if(item.status === checkStatus){
						count++;
					}
					ids.push(item._id);
				});
				if(count === that.table1.multipleSelection.length){
					vk.callFunction({
						url:'admin/business/sys/order.updateReadySend',
						data:{
							ids,
							mode,
						},
						title: '修改中...',
						success: (data) => {
							that.refresh();
						}
					});
				}else{
					that.$message.error({
						message:errorMsg,
						type:'warning',
						duration:1800
					});
				}
			},
			showExportExcel(){
				vk.pubfn.openForm('exportExcel',{ columns: this.table1.columns });
			},
			// 订单导出
			exportExcel(columns){
				that.$refs.table1.exportExcel({
					columns
				});
			}
		},
		// 监听属性
		watch: {

		},
		// 计算属性
		computed: {

		}
	};
</script>
<style lang="scss" scoped>
	.group-badge{
		::v-deep .el-badge__content.is-fixed{
			z-index: 2;
			right: 20px;
			text-align: right;
		}
	}
</style>
